<?php

namespace Sharks\Core\Http\Form;

use Sharks\Core\Http\Form\FormFile;
use Sharks\Core\Support\Bag\ParameterBag;

/**
 * 表单文件
 */
class FormFiles
{

    private $files;

    public function __construct() {
        $this->files = new ParameterBag($_FILES);
    }

    public function has($name) {
        return $this->files->has($name);
    }

    public function get($name) {
        if ($this->files->has($name)) {
            return new FormFile($this->files->get($name));
        }
        return null;
    }

}